/* 
 SPU 相关的数据类型
  */

// 基础销售属性类型
export interface BaseSaleAttrModel {
  id: number;
  name: string;
}
// 基础销售属性列表类型
export type BaseSaleAttrListModel = BaseSaleAttrModel[];

//获取数据的形参约束
export interface SpuParamsListModel {
  page: number;
  limit: number;
  category3Id: number;
}

// SPU的图片
export interface SpuImageModel {
  id?: number;
  spuId?: number;

  imgName: string;
  imgUrl: string;

  //因el-upload 需要的属性是 name,url
  name?: string;
  url?: string;
  response?: { data: string };
}
//SPU图片列表
export type SpuImageListModel = SpuImageModel[];
//
// export interface SpuPosterModel {
//   id: number;
//   imgName: string;
//   imgUrl: string;
//   spuId: number;
// }

// export type SpuPosterListModel = [];

//SPU销售值属性
export interface SpuSaleAttrValueModel {
  id?: number;
  // isChecked: string;
  saleAttrName?: string;
  spuId?: number;
  baseSaleAttrId: number;
  saleAttrValueName: string;
}
//SPU销售值列表
export type SpuSaleAttrValueListModel = SpuSaleAttrValueModel[];

//SPU销售属性
export interface SpuSaleAttrModel {
  id?: number;
  spuId?: number;

  saleAttrName: string;
  baseSaleAttrId: number;
  spuSaleAttrValueList: SpuSaleAttrValueListModel;

  //显示需要
  isEdist?: boolean;
  valueId?: number;
}

//SPU销售列表
export type SpuSaleAttrListModel = SpuSaleAttrModel[];

// Spu的records的类型
export interface SpuValueModel {
  category3Id: number | undefined;
  description: string;
  id?: number;
  spuImageList: SpuImageListModel;
  spuName: string;
  // spuPosterList: SpuPosterListModel;
  spuSaleAttrList: SpuSaleAttrListModel;
  tmId: number | undefined;
}
// Spu的records的类型数组
export type SpuValueListModel = SpuValueModel[];
// SPU分页列表
export interface SpuListModel {
  // current: number;
  // hitCount: true;
  // pages: number;
  records: SpuValueListModel;
  // searchCount: true;
  // size: number;
  total: number;
}
// export type SpuModel = SpuListModel[];
